`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    20:21:17 04/23/2014 
// Design Name: 
// Module Name:    digGrid2 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module digGrid2(digitGrid, hc, vc, blank, digX, digY, digOUT);

	input[24:1] digitGrid;  // each bit sets a square on or off in the 12x16 grid, 
									// starting with bit 48 for the top left of the grid
	
	input signed [11:0] hc,vc; // h and v scanner from VGA display
	input blank;
	input signed [11:0] digX,digY; // relative top left corner to draw digit from
	
	output digOUT;
	
	wire sq25,sq26,sq27,sq28,sq29,sq30,
		  sq31,sq32,sq33,sq34,sq35,sq36,
		  sq37,sq38,sq39,sq40,sq41,sq42,
		  sq43,sq44,sq45,sq46,sq47,sq48;
		  
		drawSq s_25(digitGrid[24],hc,vc,blank,digX,(digY+12'd 8),sq25);
		drawSq s_26(digitGrid[23],hc,vc,blank,(digX+12'd 2),(digY+12'd 8),sq26);
		drawSq s_27(digitGrid[22],hc,vc,blank,(digX+12'd 4),(digY+12'd 8),sq27);
		drawSq s_28(digitGrid[21],hc,vc,blank,(digX+12'd 6),(digY+12'd 8),sq28);
		drawSq s_29(digitGrid[20],hc,vc,blank,(digX+12'd 8),(digY+12'd 8),sq29);
		drawSq s_30(digitGrid[19],hc,vc,blank,(digX+12'd 10),(digY+12'd 8),sq30);
		drawSq s_31(digitGrid[18],hc,vc,blank,digX,(digY+12'd 10),sq31);
		drawSq s_32(digitGrid[17],hc,vc,blank,(digX+12'd 2),(digY+12'd 10),sq32);
		drawSq s_33(digitGrid[16],hc,vc,blank,(digX+12'd 4),(digY+12'd 10),sq33);
		drawSq s_34(digitGrid[15],hc,vc,blank,(digX+12'd 6),(digY+12'd 10),sq34);
		drawSq s_35(digitGrid[14],hc,vc,blank,(digX+12'd 8),(digY+12'd 10),sq35);
		drawSq s_36(digitGrid[13],hc,vc,blank,(digX+12'd 10),(digY+12'd 10),sq36);
		drawSq s_37(digitGrid[12],hc,vc,blank,digX,(digY+12'd 12),sq37);
		drawSq s_38(digitGrid[11],hc,vc,blank,(digX+12'd 2),(digY+12'd 12),sq38);
		drawSq s_39(digitGrid[10],hc,vc,blank,(digX+12'd 4),(digY+12'd 12),sq39);
		drawSq s_40(digitGrid[9],hc,vc,blank,(digX+12'd 6),(digY+12'd 12),sq40);
		drawSq s_41(digitGrid[8],hc,vc,blank,(digX+12'd 8),(digY+12'd 12),sq41);
		drawSq s_42(digitGrid[7],hc,vc,blank,(digX+12'd 10),(digY+12'd 12),sq42);
		drawSq s_43(digitGrid[6],hc,vc,blank,digX,(digY+12'd 14),sq43);
		drawSq s_44(digitGrid[5],hc,vc,blank,(digX+12'd 2),(digY+12'd 14),sq44);
		drawSq s_45(digitGrid[4],hc,vc,blank,(digX+12'd 4),(digY+12'd 14),sq45);
		drawSq s_46(digitGrid[3],hc,vc,blank,(digX+12'd 6),(digY+12'd 14),sq46);
		drawSq s_47(digitGrid[2],hc,vc,blank,(digX+12'd 8),(digY+12'd 14),sq47);
		drawSq s_48(digitGrid[1],hc,vc,blank,(digX+12'd 10),(digY+12'd 14),sq48);


	assign digOUT = (	sq25||sq26||sq27||sq28||sq29||sq30||
							sq31||sq32||sq33||sq34||sq35||sq36||
							sq37||sq38||sq39||sq40||sq41||sq42||
							sq43||sq44||sq45||sq46||sq47||sq48);

endmodule
